﻿using CfgTable;

namespace IQIGame.Onigao.GamePlay
{
    /// <summary>
    /// 类名 : API - UI - 宠物相关
    /// 作者 : Canyon / 龚阳辉
    /// 日期 : 2024-09-18 14:40
    /// 功能 : 
    /// </summary>
    public static class APIUIPet
    {
        static public string GetStrInitialCoolDown(int cooldown)
        {
            if (cooldown == 0)
                return "初始CD：无";
            else
                return string.Format("初始CD：{0}回合", cooldown);
        }

        static public string GetStrCoolDown(int cooldown)
        {
            if (cooldown == 0)
                return "使用CD：无";
            else
                return string.Format("使用CD：{0}回合", cooldown);
        }

        static public string GetStrType(int type)
        {
            return (PetType)type switch
            {
                PetType.OriginalSin => "原罪",
                PetType.Forest => "森林",
                PetType.Abyss => "深渊",
                PetType.Volcano => "火山",
                _ => "",
            };
        }

        static public string GetStrFilterWear(int state)
        {
            return (PetFiterWearType)state switch
            {
                PetFiterWearType.UnWear => "未穿戴",
                PetFiterWearType.Wear => "已穿戴",
                _ => "",
            };
        }

        static public string GetStrFilterLock(int state)
        {
            return (PetFiterLockType)state switch
            {
                PetFiterLockType.Unlocked => "未锁定",
                PetFiterLockType.Lock => "已锁定",
                _ => "",
            };
        }

        static public string GetOrderName(int index)
        {
            return APIUIConst.GetOrderName(index);
        }

        static public string GetStrSortType(int type)
        {
            return (PetSortType)type switch
            {
                PetSortType.Lv => "等级",
                PetSortType.CreateTime => "入手时间",
                PetSortType.Type => "标签",
                _ => "",
            };
        }

        static public string GetStrLimitPetInputName(string strName)
        {
            int cnt = APIUIConst.GetStrLenLimitCn(strName);
            int maxLen = TableCenter.global.PetNameMaxLen;
            if (cnt > maxLen)
                return string.Format("长度不能超过{0}", maxLen);
            return "";
        }

        static readonly public int PabilityGroupNum = 3;
        static readonly public int NoticeCid_PetFreedom = 20071;
        static readonly public int NoticeCid_SlotUnlockLv = 20072;
        static readonly public int NoticeCid_GroupUnlockLv = 20073;
        static readonly public int NoticeCid_SlotUnlockItem = 20074;
    }
}
